import { IsNotEmpty, IsEmail } from "class-validator";
import { Transform } from "class-transformer";

export class User {
  @IsNotEmpty({ message: "用户名不能为空" })
  @Transform(({ value }) => value.trim()) // 去除首尾空格
  name: string;

  @IsNotEmpty({ message: "邮箱不能为空" })
  @IsEmail({}, { message: "邮箱格式不正确" })
  email: string;
}
